/*
 * @description: 示例服务，负责对 sample 服务接口的消息交互
 * @author: 15010880
 * @update: 2015/3/3
 */
define([], function () {
    return ["$http", "$q", "constantsService", function ($http, $q, constantsService) {
        var req = function (channelName) {
            var d = $q.defer();
            $http({
                method: "post",
                url: constantsService.BASE_URL + "qrcmanage/mychannel.aspx",
                data: {
                    channelName: channelName
                }
            }).success(function (data) {
                if (data.ret != "0") {
                    d.reject(data.msg);
                    return;
                }
                d.resolve(true);

            }).error(function (error) {
                d.reject(error);
            });
            return d.promise;
        };
        return {
            request: req
        }
    }];
});